#include "Player.h"
#include "Entity.h"
#include "../Graphic/Graphic.h"

void Entity_Player_Init() {
    Entity_AddType( 1 , &Entity_Player_Function, &Entity_Player_Graphic);
}

void Entity_Player_Physic() {

}

void Entity_Player_Right( struct sEntity *Obj ) {
    Obj->velX = 0.1+(Obj->velX*0.9);
    if(Obj->velX > 1)
        Obj->velX = 1;
}

void Entity_Player_Left(struct sEntity *Obj) {
    if(Obj->velX < -1)
        Obj->velX = -1;
}

void Entity_Player_Function( struct sEntity *Obj ){


    Graphic_Camera(Obj->X, Obj->Y);
}

void Entity_Player_Graphic( struct sEntity *Obj ) {
    Obj->Animation_Num = Obj->Animation_Num%4;
    logDebug("%d", Obj->Animation_Num);
    Graphic_LoadPlayer( 0, Obj->Animation_Num);
    //logDebug("%d", Obj->Animation_Num);
    Graphic_Draw(Obj->X, Obj->Y, 2, 1);
}
